package com.kevin.data.jvm;

import lombok.SneakyThrows;

/**
 * 测试Jstat命令 jstat -gc 43297 1000 10
 *
 * @author Kevin Liu
 * @since 1.0.0
 */
public class JstatTest {

    public static void main(String[] args) throws InterruptedException {
        Thread.sleep(30000);
        System.out.println("开始执行");
        while (true) {
            loadData();
        }
    }

    @SneakyThrows
    private static void loadData() {
        byte[] data = null;
        for (int i = 0; i < 50; i++) {
            data = new byte[1024 * 100];
        }
        data = null;
        Thread.sleep(1000);
    }
}
